//
//  TSPreviewImageController.m
//  chart
//
//  Created by 曾斌 on 15/12/5.
//  Copyright (c) 2015年 xu. All rights reserved.
//

#import "TSPreviewImageController.h"

@implementation TSPreviewImageController
@synthesize imgPath;
- (void)viewDidLoad
{
    [super viewDidLoad];
    
    self.title =@"预览图片";
    
    WS(weakSelf);
    [self leftBarButtonWithTitle:@"返回" barNorImage:[UIImage imageNamed:@"nav_dark_close"] barHltImage:nil action:^{
        if (!weakSelf) {
            return;
        }
        
        [weakSelf.navigationController popViewControllerAnimated:YES];
    }];
    
    [self createTextField];
}

-(void)createTextField
{
    float margin = 10;
    float width = [UIScreen mainScreen].applicationFrame.size.width-margin*2;
    float height = 400;
    CGRect rect = CGRectMake(10, 50, width, height);
    UIImageView * iv_image = [[UIImageView alloc] initWithFrame:rect];
    iv_image.backgroundColor= [UIColor whiteColor];
    [iv_image setImage:[UIImage imageNamed:imgPath]];
    [self.view addSubview:iv_image];
}
@end
